{% extends "_regexbase.html" %}
{% block title %}Regex Helper: Replace{% endblock %}

{% block header %}Regex Helper: Replace v{{ version }}{% endblock %}

{% block form %}
<form method="post" action="/regexreplace.html">
<div class="row-fluid">
	<div class="span4">
		<label for="matchpattern">Pattern to replace:</label>
	</div>
	<div class="span8">
		<input type="text" 
		    size="17px"
		    name="matchpattern" 
		    AUTOCOMPLETE=OFF
		    title="pattern to replace"
		    onKeyPress="return submitenter(this,event)" 
			value="{{ matchpattern }}" /> <br>
	</div>
</div>

<div class="row-fluid">
	<div class="span4">
		<label for="replpattern">Replace with:</label>
	</div>
	<div class="span8">
		<input type="text" 
			size="21px"
			name="replpattern" 
			title="replace with" 
			onKeyPress="return submitenter(this,event)"
			AUTOCOMPLETE=OFF
			value="{{ replpattern }}" /> <br>
	</div>
</div>

<div class="row-fluid">
	<div class="span4">
		<label for="count">Count: </label>
	</div>
	<div class="span8">
		<input type="text" 
			name="count" 
			title="pattern to match"
			size="2px"
			AUTOCOMPLETE=OFF
			onKeyPress="return submitenter(this,event)"
			value="{{ count }}" /> <br>
	</div>
</div>

<div class="row-fluid">
	<div class="span8 offset4"> 
		<textarea cols="40" rows="5" name="texttomatch" AUTOCOMPLETE=OFF onKeyPress="return submitenter(this,event)" 
	  	placeholder="Enter your text to process here.">{% if texttomatch %}{{ texttomatch|safe }}{% endif %}</textarea>	</div>
</div>


<div class="row-fluid">
	
	<div id="buttons" class="span4">
		<input type="submit" value="Run!"/>
		<input type="submit" value="Clear" onclick="window.location='{{ path }}'; return false;"/>
	</div id="buttons">
	
	<div class="span5 offset3">
		<div id="checkboxen">
			<input type="checkbox" value="checked" name="i" {{ichecked}}>i
			<input type="checkbox" value="checked" name="m" {{mchecked}}>m
			<input type="checkbox" value="checked" name="s" {{schecked}}>s
			<input type="checkbox" value="checked" name="x" {{xchecked}}>x
			<input type="checkbox" value="checked" name="g" {{gchecked}}>g
		</div>
	</div>
	
	<br>
	
</div>

</form>
{% endblock %}